<template>
  <div class="p16 flex-column-null-between container" style="width: 100%;">


    <div  style="height: calc(100vh - 250px);width: 98%">
      <el-table
          :data="tableData"
          size="small"
          border
          :row-style="{height:'0'}"
          height="calc(100vh - 300px)"
          v-loading="loading">
        <el-table-column
            v-for="(item,index) in fields"
            :key="index"
            :label="item.label"
            :prop="item.prop"
            :min-width="item.width"
            :fixed="item.fixed"
        >
        </el-table-column>

      </el-table>

    </div>

  </div>
</template>

<script>
import {getTaskApprovalHist} from '@/api/workflowTask'
import {getUser} from "@/api/user";
export default {
  components:{
  },
  data() {
    return {
      user:{},
      loading: false,
      fields:[
        {
          label:"节点名称",
          prop:"nodeName",
          width:120
        },{
          label:"任务操作人ID",
          prop:"actorId",
          width:120
        },{
          label:"任务操作人名称",
          prop:"actorName",
          width:150
        },{
          label:"操作类型",
          prop:"operateTypeName",
          width:120
        },{
          label:"任务处理日期",
          prop:"executeTime",
          width:150
        },{
          label:"意见",
          prop:"suggest",
          width:250
        }
      ],
      tableData: [],
      workflowDetail:{},
      details:{}
    }
  },
  created() {
    this.getNowUser();
  },
  methods: {
    showProcess(row){
      this.loading = true;
      this.workflowDetail = row;
      this.details = this.workflowDetail.details;
      this.getSuggestList();
    },
    async getNowUser(){
      let ret =  await getUser();
      this.user = ret.data.user;
    },

    async getSuggestList(){
      let ret = await getTaskApprovalHist({processInstanceId:this.workflowDetail.processInstanceId});
      this.tableData = ret.data;
      this.loading = false;
    },
  },

}
</script>


<style src="../../css/index.scss" lang="scss"></style>
<style lang="scss" scoped>
.search-item{
  float: left;
  margin: 0 20px 20px 0;
  span{
    color: #606266;
    font-size: 14px;
    margin-right: 0px;
  }
}
.workProcessClass{
  height: 500px;
  overflow: auto;
  border: 1px solid #ebeef5;
  border-radius: 4px;
  background: white;
}
</style>
